package com.yb.project.algorithm.practice.test;

import java.util.HashSet;
import java.util.Set;

public class Main2 {
    // n<=63
    public static String binaryStr_sub(String[] nums,int n){
        Set<Long> set =new HashSet<>();
        for(int j=0;j<nums.length;j++){
            set.add(Long.valueOf(nums[j],2));
        }
        Long max = (long)Math.pow(2,n-1);
        for(long i=0;i<=max;i++){
            if(!set.contains(i)){
                String res = Long.toBinaryString(i);
                int len = res.length();
                StringBuilder sb = new StringBuilder();
                while(len<n){
                    sb.append(0);
                    len++;
                }
                return sb.append(res).toString();
            }
        }
        return null;
    }
}
